<template>
	<div style="margin-top: 20%;">
		<!-- 入库 -->
		<view class="card_back" @click="goToPage('/pages/equipment/ware/index')"
			style="background-image: url('https://czsc.oss-cn-beijing.aliyuncs.com/mini/material_warehouse.jpg');">
			<div class="card_title">
				设备物资入库
			</div>
		</view>
		<!-- 出库 -->
		<view class="card_back" @click="equiqment_issue()"
			style="background-image: url('https://czsc.oss-cn-beijing.aliyuncs.com/mini/material_Issue.jpg');">
			<div class="card_title">
				设备物资出库
			</div>
		</view>
		<!-- 废旧配件处置 -->
		<view class="card_back" @click="goToPage('/pages/equipment/old/index')"
			style="background-image: url('https://czsc.oss-cn-beijing.aliyuncs.com/mini/material_Issue.jpg');">
			<div class="card_title">
				废旧配件处置
			</div>
		</view>
		<!-- 扫码 -->
		<div style="width: 95%;margin: auto;">
			<van-button type="primary" block color="#4142F4" @click="scanCodeMaterial()">扫一扫</van-button>
		</div>
	</div>
</template>

<script>
	import {
		BaseUrl
	} from '@/util/util.js';
	const PrefixUrl = BaseUrl();
	export default {
		data() {
			return {

			}
		},
		created() {

		},
		methods: {
			goToPage(url) {
				//保留当前页面，跳转到应用内的某个页面，使用uni.navigateBack可以返回到原页面。
				uni.navigateTo({
					url: url
				});

			},
			scanCodeMaterial() {

				uni.scanCode({
					success: function(res) {
						uni.navigateTo({
							url: "/pages/equipment/sacnf/index?id=" + res.result
						});
					}
				});
			},
			equiqment_issue() {
				uni.scanCode({
					success: function(res) {
						uni.navigateTo({
							url: "/pages/equipment/issue/issue_detail?id=" + res.result
						});
					}
				});
			}
		}
	}
</script>

<style>
	.card_back {
		width: calc(100% - 100rpx);
		;
		background-color: burlywood;
		margin: 60rpx 20rpx;
		border-radius: 20rpx;
		text-align: center;
		padding: 30rpx;
		background-size: 85%;
	}

	.card_title {
		padding: 80rpx;
		font-size: 48rpx;
		color: white;
	}
</style>
